#include "semihosting.h"

extern void host_call(HostSystemCall type, void *args);

int host_read(int fd, void *buf, uint32_t length) {
	ParameterUnion semi_param[3] = {
			{.paramInt = fd},
			{.paramPointer = buf},
			{.paramInt = length}
	};

	host_call(HOSTCALL_READ, semi_param);
}

int host_write(int fd, const void *buf, uint32_t length) {
	ParameterUnion semi_param[3] = {
			{.paramInt = fd},
			{.paramPointer = (void *) buf},
			{.paramInt = length}
	};

	host_call(HOSTCALL_WRITE, semi_param);
}

